n=3
# [x for x in range(10001) if (lambda s: sum(int(i)**n for i in s) == x)(str(x))]
result=[]
def f(s):
    total=0
    for i in s:
        ss=int(i)**n
        total+=ss
    return total == x
for x in range(10001):
    if f(str(x)):
        result.append(x)
print(result)
